Skip to content

feat(pipeline): Support GitHub Actions commit enumeration - #6012

Merged
michaelkedar merged 6 commits into
google:masterfrom
Dwdr:gha-commit-enricher
Sep 15, 2026
Merged

michaelkedar merged 6 commits into
google:masterfrom
Dwdr:gha-commit-enricher

Conversation

@Dwdr

@Dwdr Dwdr commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Overview

Adds automated Git commit enumeration support for the GitHub Actions ecosystem within the OSV worker pipeline (go/internal/worker/pipeline/githubactions/).

Fixes #6013

Details

Currently, GitHub Actions advisories imported into OSV only specify SEMVER or ECOSYSTEM version ranges. When workflows pin actions to immutable Git commit SHAs (as recommended by OpenSSF Scorecard), vulnerability scanners querying OSV by commit SHA cannot match these advisories.

This pull request implements:

  1. Repository Extraction (ExtractGitHubRepoURL): Parses GitHub Action package identifiers into their canonical repository URLs (https://github.com/<owner>/<repo>), gracefully handling nested sub-action directories (e.g., docker/build-push-action/v2), leading slashes, .git suffixes, and directory traversal (..) attempts.
  2. Pipeline Enricher (githubactions.Enricher): Inspects vulnerability records affecting the GitHub Actions ecosystem. For each affected package, it extracts the repository URL and injects companion Range_GIT ranges duplicating the version events (introduced / fixed / last_affected).
  3. Downstream Gitter Activation: Because OSV's worker engine already inspects Range_GIT ranges and queries the Gitter service, injecting companion Range_GIT ranges automatically enumerates intermediate commits and tags into affected.versions with zero changes required to Gitter or the core engine.
  4. Idempotency & Safety: Duplicate runs of Enrich do not duplicate existing Range_GIT entries, and events are deep-copied to prevent shared pointer mutation.
  5. Registry Integration: Registers &githubactions.Enricher{} in internal/worker/pipeline/registry/registry.go.

Testing

  • Added 25 table-driven unit tests in go/internal/worker/pipeline/githubactions/githubactions_test.go covering URL canonicalization, sub-action normalization, malicious path handling, SEMVER/ECOSYSTEM range companion generation, non-GitHub Actions filtering, and idempotency.
  • Ran all unit tests concurrently with the Go data race detector:
    go test -race -v ./internal/worker/pipeline/githubactions/... (100% PASS).
  • Verified code formatting and vetting:
    gofmt -s -d (0 diffs).
    go vet ./internal/worker/pipeline/githubactions/... (0 warnings).
  • Cleaned up all linter checks (stringscutprefix, nlreturn, and protogetter protobuf accessor compliance).

@Dwdr

Dwdr commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

@G-Rath

G-Rath commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Please read our contributing guide before opening pull requests

@G-Rath G-Rath closed this Sep 10, 2026
@Dwdr

Dwdr commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

Apologies @G-Rath ! I missed the issue creation step.

I have opened a tracking issue #6013 per the contributing guide 🙏

@michaelkedar michaelkedar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this!

Comment thread go/internal/worker/pipeline/githubactions/githubactions.go Outdated
Comment thread go/internal/worker/pipeline/githubactions/githubactions.go Outdated
Comment thread go/internal/worker/pipeline/githubactions/githubactions.go Outdated
@Dwdr
Dwdr force-pushed the gha-commit-enricher branch from d1354a9 to 9bae0b6 Compare September 11, 2026 04:40
@Dwdr
Dwdr force-pushed the gha-commit-enricher branch from 9bae0b6 to e2b8517 Compare September 11, 2026 05:03
@Dwdr
Dwdr requested a review from michaelkedar September 14, 2026 07:27
@michaelkedar

Copy link
Copy Markdown
Member

/gcbrun

@michaelkedar

Copy link
Copy Markdown
Member

/gcbrun

@michaelkedar michaelkedar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
one thing though:
can you set ignore_git here and here to False

Happy to merge with that change

@Dwdr

Dwdr commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

@michaelkedar got it! I've set both ignore_git to False. Thanks for reviewing!

@Dwdr
Dwdr requested a review from michaelkedar September 15, 2026 03:24
@michaelkedar

Copy link
Copy Markdown
Member

/gcbrun

@michaelkedar michaelkedar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this!

@michaelkedar
michaelkedar merged commit e74fec6 into google:master Sep 15, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Support Git commit enumeration for GitHub Actions ecosystem

4 participants